Is it my code or the Adapter failing here?

This is pretty simple code that I’ve used a hundred times before with different adapters. Have I overlooked something?

The where clause does not seem to be working.

    public DataSet GetJob(string jobNum)
        {
            bool more;
            JobPartAdapter jpAdapter = new JobPartAdapter(oTrans);
            jpAdapter.BOConnect();
            SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
            opts.PageSize = 20; //return this many
            string where = string.Format("JobNum = '{0}'", jobNum); 
            opts.NamedSearch.WhereClauses.Add("job", where);
            var jobs = jpAdapter.GetRows(opts, out more);
            return jobs;
  
        }

What exactly is failing?
Edit: I guess I should read a little slower :slight_smile:
Have you tried passing this job num into the BL tester and writing your whereClause there to see what it returns?

I don’t even have the BL tester setup. I’ve never used it - sounds like it’s time to start.

It can be useful for sure. I think another place to look at is your named search parameter. Is “job” what it’s expecting for that type of data?

Any idea how to find it on EpicWeb? - their search leaves much to be desired

Also, are you talking about this line?

opts.NamedSearch.WhereClauses.Add("job", where)

It was my understanding the first parameter in WhereClauses.Add was just the name of the search, and had little bearing.

I don’t, sorry.
You could be right about that.

can you try using a search filter instead of a named search?

opts.DataSetMode = DataSetMode.RowsDataSet;
opts.PreLoadSearchFilter = string.Format(“JobNum = ‘{0}’”, jobNum);
jpAdapter.InvokeSearch(opts);

You’ll need to return the dataset from the adapter after the call.

1 Like

\""\erp10\ERP10.1.500.0\Utilities
is where the BL Tester folder is located for me…

1 Like

@Chris_Conn pretty sure the key is JobHead not “Job” try that.

I didn’t realize that field was for anything other than the ‘name’ of the search. I tried all the suggestion to no avail.

Now I am trying to figure out how to get BL Tester to connect

I believe that’s the HashKey

TargetInvocationException

Inner Exception:
A call to SSPI failed, see inner exception.

Server stack trace:
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Open()
at Epicor.ServiceModel.Channels.ChannelEntry1.CreateNewChannel() at Epicor.ServiceModel.Channels.ChannelEntry1.CreateChannel()
at Epicor.ServiceModel.Channels.ChannelEntry1.GetContract() at Epicor.ServiceModel.Channels.ImplBase1.GetChannel()
at Epicor.ServiceModel.Channels.ImplBase`1.HandleContractBeforeCall()
at Ice.Proxy.BO.UserFileImpl.GetRows(String whereClauseUserFile, String whereClauseUserComp, String whereClauseUserCompExt, Int32 pageSize, Int32 absolutePage, Boolean& morePages)
Inner Exception:
A call to SSPI failed, see inner exception.
at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)
at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.CheckCompletionBeforeNextSend(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.StartReceiveBlob(LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.CheckCompletionBeforeNextReceive(LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.CheckCompletionBeforeNextSend(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.StartReceiveBlob(LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.CheckCompletionBeforeNextReceive(LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, ChannelBinding binding, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
Inner Exception:
The target principal name is incorrect

Oh JOY SSPI issues… le sigh…
Is this your BL Tester?

Yep

I know how to fix that in code LoL but not on the UI… Does your Setup for BL tester match the setup of the App Server? (Screen shot)?

I got the tcp address from my sysconfig. I tried both Windows and Username over WC settings

Perhaps on an unrelated note, when I VPN in from home now I can’t use my local Epicor client, (used to work) it never authenticates - I have to remote into my work PC.

Do you not have access to the Admin Console (still?)
What does the sysconfig say? Usually if its Windows you don’t use username / password

AH! you may have lost Trust to the DC… that’s one reason for SSPI. Try un-joining the domain and re-joining the domain / reboot

Let’s assume for a minute I could see the Admin Console - it might look like this:

The issue with the VPN I described only happens at home - I am at work now.

Yeah that should work, SSPI is generally an Auth issue with WCF… Try adding an Entry to Credentials Manager in your Computer



And try again