400 Bad Request after calling Java web service through C#

I'm getting a 400 Bad Request Error after calling a Java web service through C#.  I'm using Visual Studio 2015.  I got the WSDL file from the client and I added the file as a service reference in my solution.

Here is my app.config settings:
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="messages"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="c:\logs\messages.xml" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>


  <system.serviceModel>
    <diagnostics>
      <messageLogging
           logEntireMessage="true"
           logMalformedMessages="false"
           logMessagesAtServiceLevel="true"
           logMessagesAtTransportLevel="false"
           maxMessagesToLog="3000"
           maxSizeOfMessageToLog="2000"/>
    </diagnostics>
    <bindings>
        <wsHttpBinding>
          <binding name="CoreSoapPortBinding">
            <security mode="Transport">  
              <transport clientCredentialType="Certificate"/>  
            </security>  
          </binding>  
        </wsHttpBinding>  
    </bindings>
    <client>
        <endpoint address="https://xxxxxxxxx/ESARWS/CORETransactionService"
            binding="wsHttpBinding" bindingConfiguration="CoreSoapPortBinding"
            contract="ESAR.CORETransaction" name="CoreSoapPort" behaviorConfiguration="endpointCredentialBehavior" />
    </client>
   <behaviors>  
     <endpointBehaviors>  
        <behavior name="endpointCredentialBehavior">  
          <clientCredentials>  
            <clientCertificate findValue="xxxxxxxx.org"
                               storeLocation="CurrentUser"  
                               storeName="My"
                               x509FindType="FindBySubjectName" />
           <serviceCertificate>
             <defaultCertificate findValue="xxxxxxx.gov"
                               storeLocation="CurrentUser"  
                               storeName="AddressBook"
                               x509FindType="FindBySubjectName" />   
        
           </serviceCertificate>
        
          </clientCredentials>  
        </behavior>  
     </endpointBehaviors>  
  </behaviors>  
    
</system.serviceModel> 

Open in new window


Here is the error I'm getting:
Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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 ESARWS.ESAR.CORETransaction.COREEnvelopeBatchSubmission(COREEnvelopeBatchSubmissionRequest request)
   at ESARWS.ESAR.CORETransactionClient.ESARWS.ESAR.CORETransaction.COREEnvelopeBatchSubmission(COREEnvelopeBatchSubmissionRequest request) in C:\Crap\CARES\ESARWS\Service References\ESAR\Reference.cs:line 664
   at ESARWS.ESAR.CORETransactionClient.COREEnvelopeBatchSubmission(String& PayloadType, String& ProcessingMode, String& PayloadID, String PayloadLength, String& TimeStamp, String& SenderID, String& ReceiverID, String& CORERuleVersion, String& CheckSum, String Payload, Byte[]& Payload1, String& ErrorCode, String& ErrorMessage) in C:\Crap\CARES\ESARWS\Service References\ESAR\Reference.cs:line 680
   at ESARWS.ESAR278Operations.BatchSubmission() in C:\Crap\CARES\ESARWS\ESAR278Operations.cs:line 102

Open in new window


Is one of my configuration settings not right?? I have also noticed that my request is not encrypted after I look at my log file.
LVL 1
HItesh RanaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
Encryption has nothing to do with bad request. A bad request means that you do not send the correct request to the server. You probably miss something in the data.

Can you try loading the WSDL through SoapUI and see if you are able to send a request from there?
HItesh RanaAuthor Commented:
Thanks for the tip. I used the WSDL the client gave me and imported in SOAP Ui.  What I did was get the xml from the log file ( the file I specified in the diagnostic section in the app.config) that .NET generated and I put that in soap UI and it worked.  Now I'm more lost than before.  I was hoping it did not work.   Then I would go okay.  Maybe I'm not setting a parameter or something.  Any other ideas?
girionisCommented:
If it worked from the SoapUI then it means that the XML from the log file is correct and that the web service works as expected. Obviously the problem is in the C#/Visual Studio somewhere.

Have you looked at this tutorial?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

HItesh RanaAuthor Commented:
Thank you for the quick response. I have created web services in the past for a few years where the front-end developers consumed them.   Not sure where the bug would be.  I'm assuming its in the app.config file.    Do you see see any stupid errors I made in the app.config file?
girionisCommented:
Sorry, I edited the link, I have posted a new one that describes the steps to consume a web service from C#. Have a look and tell me if it helps.
HItesh RanaAuthor Commented:
No worries.  Did you mean these steps:
1)Right click on References
2)select Add Service Reference
3) give the wsdl address in the address textbox
4) click Discover
5) Give a name for the namespace eg;- BFG
6) You can access the resources like BFG.MethodName() from you code

I did exactly this. Except my wsdl file was local.  So I just pointed to the file to my local system.  I think the issue is somewhere in the app.config file.  Consuming the web service is not hard.  You make the call to the function and pass in the parameters.  Its like any other function call.  Something in the app.config is not right.  That is what I'm thinking.
girionisCommented:
Yes these are the steps I meant. Can you try to enable tracing: https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/tracing/configuring-tracing ? It will give you more information on why the server is rejecting your request.
HItesh RanaAuthor Commented:
I actually do have this part of the tracing on:
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="messages"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="c:\logs\messages.xml" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

Open in new window


I paste the soap generated in the log file into SOAP UI and it works.   Should I be turning anything else on?  

I also tried manually creating a web service in C#.  Meaning without WCF.  I created a new post for that here.  https://www.experts-exchange.com/questions/29090732/400-or-500-error-after-calling-Java-WS-from-C.html
girionisCommented:
I am not sure if this is enough. If you look at the link I posted it has some more logging. Can you try this as well? It's definitely something that has to do with your setup and not with the web service itself.
HItesh RanaAuthor Commented:
I changed the tracing to All and I got the same xml log file.
girionisCommented:
Does it only show the XML file or more information?
HItesh RanaAuthor Commented:
So the data I'm passing to the server is not being encrypted.  I know this because I compared between SOAPUI and .NET  in fiddler.  I'm guessing the configuration settings in my app.config file are not correct.  They seem correct to me.
girionisCommented:
Does SOAP UI encrypt the data?
HItesh RanaAuthor Commented:
This is what I see in fiddler for SOAP UI:

------=_Part_31_7314110.1522073646059
Content-Type: application/soap+xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>

<soap:Envelope xmlns:int="http://interfaces.services.dhcs.ca.gov/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="35E54383F815C57E721522073646058239">MIIGJTCCBQ2gAwIBAgIRAOI3mEvrFfiPB5xNWTFBMGswDQYJK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EFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwUAYDVR0gBEkwRzA7BgwrBgEEAbIxAQIBAwQwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMwCAYGZ4EMAQICMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQU9yZ2FuaXphdGlvblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYsGCCsGAQUFBwEBBH8wfTBVBggrBgEFBQcwAoZJaHR0cDovL2NydC5jb21vZG9jYS5jb20vQ09NT0RPUlNBT3JnYW5pemF0aW9uVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMD8GA1UdEQQ4MDaCF2Ntc3Byb3ZpZGVyLmNhaHduZXQuZ292ght3d3cuY21zcHJvdmlkZXIuY2Fod25ldC5nb3YwDQYJKoZIhvcNAQELBQADggEBAByJZY5kfeo6TmYjcn0Afsl2WokUKm6aQda1MmgfZAdFIxTFixiRfWdZVLTQ9Qi93Pili3Zz6sEadHWlQjhnGnnJTQlL31KUi22dqIENuFXGqNOouefscqbh1vimPTg7yub85dXxPZYCUafVQbxt4IADQ8WROQJAGPbjTXjJPPlclH/dB0tTjAdyzNcyLxXtUGMM9FmRp9W99VKQsoi1L/Byo7fvk1Mw6921g1Pi5zgrt19FGYD0pqSNOrFfjb5DZiID7XqWZ1Be5Ha0S+qwFySkHbwWZXKCfltEyfHPHx+gWec4kClouTs7TGY7oIyfoHIgBChiygSjVcAZCKO7WiU=</wsse:BinarySecurityToken><xenc:EncryptedKey Id="EK-35E54383F815C57E721522073646058238" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference><wsse:Reference URI="#35E54383F815C57E721522073646058239" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>D0QnFQINT+eM/UnVJE32kPF0lgCbhpmgsGK9A2clyADu7qnng89jq9QdegfTdRSxcGv9nWxFss1qGkvfB3iiF+Ux7+bexMuyDZdjSE0np3zBuwQ+3yN9/iAsJBBgqx9Bj0s+PnS0QgQbRUGkWsWUKMnkSHLirTFxjKV+LPJQRxJLLvcWj6fez8XlxJoUCDa/LJwDuMFtCv4rkfatLlzdNJGNWml51HZnwgZKDsBOwGKNzrJBnSaP6UCbE7nmPn5Qb3U6x8yfHRomGlFYHtqmURkFeUfllOlMYIWl6GOoLzDU6OarqHOwnIISVjfGwadKnCf2AdHfZ1WHeMxKhz44EA==</xenc:CipherValue></xenc:CipherData><xenc:ReferenceList><xenc:DataReference URI="#ED-35E54383F815C57E721522073646058240"/></xenc:ReferenceList></xenc:EncryptedKey><wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-35E54383F815C57E721522073646023233">MIIF+TCCBOGgAwIBAgIQIWv3OdE866kXP/MQVRf4fjANBgkqhkiG9w0BAQsFADCBljELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxPDA6BgNVBAMTM0NPTU9ETyBSU0EgT3JnYW5pemF0aW9uIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTAeFw0xODAxMDMwMDAwMDBaFw0yMTAxMDIyMzU5NTlaMIHVMQswCQYDVQQGEwJV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CBiwYIKwYBBQUHAQEEfzB9MFUGCCsGAQUFBzAChklodHRwOi8vY3J0LmNvbW9kb2NhLmNvbS9DT01PRE9SU0FPcmdhbml6YXRpb25WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wQQYDVR0RBDowOIIdY25wZGNudjAyNDMyLmRjbGQucGxkYy5rcC5vcmeCF2Njc25jYWwtZGV2LmFwcGwua3Aub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQBAzsi+uMrY4lWIwXNWWp5QbdZaFgHDiCi49nzcSJJuMR73DjowTsOrFXM7/se71nGRVzKBHdjomvA6MO1OIosLxw1aweH071kz29NZT2ZX0d5khFVHXf2kGu0aq9DK7qNEEx6jG713m265+lZIlozjF6hpuaCLPmPBJdaoLZq0nZ7MmGcslNdVkgiUuicEkUFAzuIM7uwTbuJCka30r03+qmxfYi0BIBcST08JB6dnfnjAZrSRXXSmuIBTei76XRjWTvKsE3yIGJShvRYSQWHthumQJ3+lV30k9rJ6bF2nByqhdO1mr1eod9u4ndl8vnxuGfv0j9Nqc+H5yPb4VNHt</wsse:BinarySecurityToken><ds:Signature Id="SIG-35E54383F815C57E721522073646024237" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="int soap" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-35E54383F815C57E721522073646023236"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="int" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>Gv8GU/vT1h3OUZMB7Lvgj3CxEjU=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>ZChgeB6dnMAW99qhwHZw8Dwb8QjRMGwIY++qXDlK9UqpMISuuLL4vkoc+31tFj3rHTsFxHJftxfdaRzyCZce2V0ioatFiw5S6hI/cyhnLVxZJK80MOx3xyYK1oT+I4DO1gTvs9v9pEK/V//qMMVV4avRaO0bFuJaW0C1X06zUj5oz/xH1XdCYSuvSMmC+dammY+b/2XXofP+JM9FRx/l5+v1hhbv+6tiC/xAmKe62Ywvw5rblw/0QzFEXOwTiUUiKFM1d5Ie0s1HQwcW1kKCpaS6oiQB+bU6Dgxg9KeSlrkTo6cuSuJ6Hn7Pe1nqCTq76saZsxJRw3PISD/4Ih8BAg==</ds:SignatureValue><ds:KeyInfo Id="KI-35E54383F815C57E721522073646023234"><wsse:SecurityTokenReference wsu:Id="STR-35E54383F815C57E721522073646023235"><wsse:Reference URI="#X509-35E54383F815C57E721522073646023233" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header>
<soap:Body wsu:Id="id-35E54383F815C57E721522073646023236" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><xenc:EncryptedData Id="ED-35E54383F815C57E721522073646058240" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference URI="#EK-35E54383F815C57E721522073646058238"/></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>pf35DvcRZ/yADZnUn+uvs+zvZ0O3YxgEOcol1pf0FVssYse0xl4h879jNqEg86WEo0b2JIIwkHII9V9RIJK/HC3Yzr/wucecUH/c5b7a6PAjdE5pGaH2mx1Be0tEz9tBdffCq7ms5vqU84UnWpPIcJiv/hka2dgkwUMYZR+9ct9QF0QcDNA+/4gJXGbTWxguGl9tvv3aD8xdZYIFH0OiZn0N1E2omYrO3fuoR0Bx2ZrqMywe6xgtHmKfXlpX8695wvYDdD1JVsniO92oUIeapgLCCIaMOjHHmDT3aPLH9muyyneJBTAv3bvOaLMu2Q8ZsiJnfoZYmrwApR9iIdv+rwRaQZEaAkMoj5rD0a28aXEbilTquv5my1XVlSUjLIUbgbQFxEANARVDfC7vz8XOKjwfrrYijPX4XkLOyO2/36OUekQxKCyH7Cwf2jG5vp9+rdxySo2+vMYM8s+LoPgydwMk7/Z0V7DKWE9+XrxF4P/BJgVCo9it8NCXC4kLsGpnns22irUUPk3puo6uV/BpMJ3qNLnrjg+i8rtDJY0DUhQRHTFAcuf2HiVZP4YHrrhvIXLmfR4rDyK180H+0gIvVtErdszQQSeBhMnSzDJMpOGTxOAhyqx59ygcDW3H5artE0rdGwtCp8fc+sr22oP+7pj2w3+LeuwcJWqVv/8isvrVEg1GqVU8l/B+JsbnRzInCXVXucsIGzMyyCBgqapQg853U5D2dLCN9yeh86dJcOc=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></soap:Body>
</soap:Envelope>
------=_Part_31_7314110.1522073646059
Content-Type: text/plain; charset=us-ascii; name=attachment.txt
Content-Transfer-Encoding: 7bit
Content-ID: <attachment.txt>
Content-Disposition: attachment; name="attachment.txt"; filename="attachment.txt"

ISA
GS
ST
BHT
HL
NM1
HL
NM1
REF


------=_Part_31_7314110.1522073646059--

Open in new window


This is what I see from .NET
--uuid:834b3cd0-5604-4985-a4bf-7ee1de75de77+id=1
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://XXXXX/CORETransaction/XXXXSubmissionRequest</a:Action><a:MessageID>urn:uuid:19ddb3e1-c7ce-4b8f-971a-df048cb1f255</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">https://xxxxxx/xxxxxService</a:To></s:Header><s:Body><COREEnvelopeBatchSubmission xmlns="http://interfaces.services.dhcs.ca.gov/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><PayloadType xmlns="">X12_278_Request_005010X217E1_2</PayloadType><PayloadID xmlns="">920c6ae8-597c-49ee-a381-d9033ed5258b</PayloadID><PayloadLength xmlns="">820</PayloadLength><TimeStamp xmlns="">2018-03-26 07:23:00Z</TimeStamp><SenderID xmlns="">Cxxxxx</SenderID><ReceiverID xmlns="">xxxxx</ReceiverID><CORERuleVersion xmlns="">4.0.0</CORERuleVersion><CheckSum xmlns="">95-6C-F3-8B-72-3F-34-3C-5D-2E-DD-7B-51-8D-47-1A-0F-70-48-41</CheckSum><Payload xmlns="">xxxxxxx</Payload></COREEnvelopeBatchSubmission></s:Body></s:Envelope>
--uuid:834b3cd0-5604-4985-a4bf-7ee1de75de77+id=1--

Open in new window

girionisCommented:
Ok, I see the problem now. You're missing some security information, so yes, you were right from the beginning, it seems that the problem could be the encyrption.

Can you have a look at this link and see if this helps?
HItesh RanaAuthor Commented:
Thank you for the response.  I made a new post with my progress here which details exactly what I did.  I read that post yesterday.  Its pretty good.  I feel I'm pretty close now.  Just the encoding for the attachment is not right.  Sorry for not sending it to you yesterday.  I completely forgot.

https://www.experts-exchange.com/questions/29091235/Web-Service-encoding-incorrect-for-attachment.html
HItesh RanaAuthor Commented:
So I started to think if the attachment being sent as binary in the .NET code was really the issue or not.

In SOAP UI:
1) I attached the encoded string that .NET produced from fiddler and set the content type to application/octet-stream.

The result was that I got a successful message.  So I guess that means the issue is not the attachment being binary or text.  My only guess now is that its a security issue still.
HItesh RanaAuthor Commented:
Thanks for your help.  I appreciate it.
girionisCommented:
Yes, it's probably a security issue, maybe encoding as well. I will look at your other question and see if I have any more ideas.
HItesh RanaAuthor Commented:
Just to double check.  This is my current problem right now.  https://www.experts-exchange.com/questions/29091863/MTOM-messages-must-have-type-'application-xop-xml'.html.    I will close out the other issues.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.