tSoap Exception: Bad response on anonymous webservice

One Star

tSoap Exception: Bad response on anonymous webservice

Hi,
I created a simple xml and tested with SoapUI. This works fine.
The webservice is free to use and no authentication is required. Whenever I use tSoap I get the Exception:
jun 11, 2015 11:55:12 AM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
SEVERE: SAAJ0008: Bad Response; Forbidden
Exception in component tSOAP_1
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (403Forbidden
 at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
 at org.talend.soap.SOAPUtil.extractContentAsDocument(SOAPUtil.java:227)
 at sagedataquality.bpostsoap_0_1.BpostSoap.tSOAP_1Process(BpostSoap.java:467)
 at sagedataquality.bpostsoap_0_1.BpostSoap.runJobInTOS(BpostSoap.java:778)
 at sagedataquality.bpostsoap_0_1.BpostSoap.main(BpostSoap.java:635)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (403Forbidden
 at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
 ... 5 more
CAUSE: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (403Forbidden
 at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
 at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)

I tried both a soap message and a document input/output.
Here is the soap message that works fine in SoapUI:
"<soapenv:Envelope xmlns:soapenv=\"\" xmlns:v001=\"\">
  <soapenv:Header/>
  <soapenv:Body>
<msg:ValidateAddressesRequest xmlns:msg=\"\">
 <msg:AddressToValidateList>
   <msg:AddressToValidate id=\"0595.848.135\">
     <msg:PostalAddress>
       <msg:DeliveryPointLocation>
         <msg:StructuredDeliveryPointLocation>
           <msg:StreetName>A DEFUISiSEAUX</msg:StreetName>
           <msg:StreetNumber>23</msg:StreetNumber>
           <msg:BoxNumber></msg:BoxNumber>
         </msg:StructuredDeliveryPointLocation>
       </msg:DeliveryPointLocation>
       <msg:PostalCodeMunicipality>
         <msg:StructuredPostalCodeMunicipality>
           <msg:PostalCode>4340</msg:PostalCode>
           <msg:MunicipalityName>Awans</msg:MunicipalityName>
         </msg:StructuredPostalCodeMunicipality>
       </msg:PostalCodeMunicipality>
       <msg:CountryName>BE</msg:CountryName>
     </msg:PostalAddress>
   </msg:AddressToValidate>
 </msg:AddressToValidateList>
 <msg:ValidateAddressOptions>
   <msg:IncludeFormatting>true</msg:IncludeFormatting>
   <msg:IncludeSuggestions>true</msg:IncludeSuggestions>
   <msg:IncludeSubmittedAddress>false</msg:IncludeSubmittedAddress>
 </msg:ValidateAddressOptions>
</msg:ValidateAddressesRequest>
  </soapenv:Body>
</soapenv:Envelope>"

The endpoint:
""

The SOAP Action:
""
Sixteen Stars

Re: tSoap Exception: Bad response on anonymous webservice

You are not setting the endpoint or soap action, or did you omit to put those details in? Also, I have seen a bad response error generated from setting the wrong SOAP Version.
One Star

Re: tSoap Exception: Bad response on anonymous webservice

You are not setting the endpoint or soap action, or did you omit to put those details in? Also, I have seen a bad response error generated from setting the wrong SOAP Version.

I can't stay logged in as member when redirecting to forum, so I can't post life URL's or upload images, but here is some info:
The documentation says to use "webservices-pub.acbpost.be/ws/ExternalMailingAddressProofingCSE_v1_1" over https but adding ?wsdl in browser shows access denied. Using _v1_0?wsdl shows the scheme but that version is unavailable in the tSoap object?
For testing with SoupUI I used endpoint webservices-pub.acbpost.be/ws/ExternalMailingAddressProofingCS_v1?wsdl over https and action schema.bpost.be/services/common/address/ExternalMailingAddressProofingCS/v001/validateAddress over http. The test works fine and SoapUI shows that it is version 1.1.
So: 
in web browser only ExternalMailingAddressProofingCSE_v1_0?wsdl tests ok, ...E_v1?wsdl and ...E_v1_1?wsdl do not
in SoupUI ExternalMailingAddressProofingCSE_v1?wsdl works ok, 
in talend ExternalMailingAddressProofingCSE_v1?wsdl,  ...v1_1?wsdl don't work (forbidden) but ..._v1_0?wsdl, now seems to work. (output in document)
Do you have any idea where this disconcordance might come from ?
Regards,
Ramses
Sixteen Stars

Re: tSoap Exception: Bad response on anonymous webservice

Have you now tried the v1_0?wsdl version in Talend? Does it work? It is very difficult to help I'm afraid without screenshots or the ability to try things out. It does look like this is likely caused by the fact that you are forbidden from seeing the wsdl though.