I have been trying to communicate with a web service to send a SOAP message, web service is configured using XI SOAP Adapter (SAP) and i have the wsdl url. When i try to send my message over HTTP by providing my wsdl url and soapaction value from wsdl. I get 405 Method not allowed error. I am using Java's HTTPUrlConnection class to send my soap envelope. The same envelope is sent just fine using SOAPUI.
Moreover, wsdl has defined two ports, if i use the port url provided in wsdl directly, my message is sent just fine w/o any issue. If i open the port url connection in browser. It says Message Servlet OK and some other details about it.
My purpose is to communicate only using wsdl url and soapaction, as internal service endpoint location can be changed any time. So i should not rely on port url to communicate. Please take a look at the wsdl provided below. If possible advise. I think this might be issue due to Adapter is being used which is not accessible via soap action. Apologies for the bad english as i am not native.
<wsdl:portType name="SEND_REQUEST">
<wsdl:documentation/>
<wsdl:operation name="SEND_REQUEST">
<wsdl:documentation/>
<wsp:Policy>
<wsp:PolicyReference URI="#OP_SEND_REQUEST"/>
</wsp:Policy>
<wsdl:input message="p1:MT_DETAILS"/>
<wsdl:output message="p1:MT_RESPONSE"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SEND_REQUESTBinding" type="p1:SEND_REQUEST">
<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="SEND_REQUEST">
<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://sap.com/xi/WebService/soap1.1"/>
<wsdl:input>
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SEND_REQUESTService">
<wsdl:port name="Simple_Port" binding="p1:SEND_REQUESTBinding">
<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://abc.local:7000/XISOAPAdapter/MessageServlet?[Some Properties here]"/>
</wsdl:port>
<wsdl:port name="Secure_Port" binding="p1:SEND_REQUESTBinding">
<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="https://abc.local:7001/XISOAPAdapter/MessageServlet?[Some Properties here]"/>
</wsdl:port>
</wsdl:service>