0

I am connecting my local system with SAP server using BizTalk adapter and also using Microsoft.servicemodel.channels to open the connection in sap to process XML as input file.

            SAPBinding binding = new SAPBinding();
            binding.ReceiveTimeout = TimeSpan.MaxValue;
            binding.SendTimeout = TimeSpan.MaxValue;
            binding.EnableBusinessObjects = true;
            binding.EnableSafeTyping = true;

         EndpointAddress address = new EndpointAddress(SAPConnectionString);
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);

// add credentials
factory.Credentials.UserName.UserName = SAPUserName;
factory.Credentials.UserName.Password = SAPPassword;

// Open client
factory.Open(TimeSpan.MaxValue);

Factory.open cannot open the connection and it through an exception as A specified module could not be found, (Exception from HRESULT : 0x8007007E)

Kindly please help me

thanks in advance.

Gopal Krishnan
  • 17
  • 1
  • 3
  • 11
  • Please also show the assignment of variable `binding`? – Gruff Apr 08 '15 at 09:36
  • yes @Gruff i edited my question please help me out – Gopal Krishnan Apr 08 '15 at 09:45
  • Is this code are enough for you. – Gopal Krishnan Apr 08 '15 at 09:48
  • Unfortunately not. It looks like there is a dependency on an assembly it is unable to find. Perhaps take a look at this: http://stackoverflow.com/questions/2522009/usage-of-biztalk-sap-adapter-without-biztalk-server-to-connect-net-and-sap – Gruff Apr 08 '15 at 09:54
  • sorry @Gruff i couldn't share the full code. thanks for your reply, but the application created by someone but i want to fix this problem,it works on windows server (2008 R2).This application passes all the xml file to sap except only one with this error(Invalid character in the given encoding. Line 1, position 1374.) i checked the whole xml file also. May i know windows 8.1 is acceptable os to run biztalk or windows server os is need? because i deploying this application in 8.1 and also am new to sap also – Gopal Krishnan Apr 08 '15 at 10:02
  • the system @Gruff without Biztalk server only the application is running. it has WCF LOB adapter SDK, Biztalk adapter pack – Gopal Krishnan Apr 08 '15 at 10:57

1 Answers1

0

The error message suggests there is a dependency on an assembly it is unable to find. Please note this is not something specific to WCF or the SAP adapter.

Googling for "HRESULT: 0x80070007E" I found: C# Unable to load DLL (Module could not be found HRESULT: 0x8007007E)

In David Heffernan's answer he recommends using tools like Dependency Walker to help debug dependency issues.

Community
  • 1
  • 1
Gruff
  • 555
  • 1
  • 9
  • 14
  • while executing the application it shows "(There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Adapters.SAP.BizTalk, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64", "x86". This mismatch may cause runtime failures.)" this warning. – Gopal Krishnan Apr 08 '15 at 12:26
  • Hi sir, please have a look at this: http://stackoverflow.com/questions/10113532/how-do-i-fix-the-visual-studio-compile-error-mismatch-between-processor-archit – Gruff Apr 08 '15 at 12:38
  • Call GK ..Thanks @gruff at last i get rid of the error(HRESULT), Now its Connecting SAP..and While giving Input (XML file) it gives an error (Invalid character in the given encoding. Line 1, position 1374.) – Gopal Krishnan Apr 09 '15 at 05:07
  • You are most welcome. This new error is a different issue, perhaps for a different question? :) – Gruff Apr 09 '15 at 07:47
  • @GopalKrishnan Welcome to Stack Overflow. If this answer helped you out, you should upvote & accept it - This is the Stack Overflow way of saying "Thank you". Read [How does accepting an answer](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235) work if you don't know how. – Gruff Apr 11 '15 at 21:51