0

I am trying to make a successful call from my "Spring Boot Application" to a SOAP API on the "Azure API Manager".

I have defined a WSDL


    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:xs="http://www.w3.org/2001/XMLSchema"
                 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                 xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                 xmlns:tns="http://www.dataaccess.com/webservicesserver/"
                 name="PutMessage"
                 targetNamespace="http://www.dataaccess.com/webservicesserver/">
      <types>
        <xs:schema elementFormDefault="qualified" targetNamespace="http://www.dataaccess.com/webservicesserver/">
          <xs:element name="PutMessage">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="message" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="PutMessageRequest">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="message" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="PutMessageResponse">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="PutMessageResult" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:schema>
      </types>
      <message name="PutMessage">
        <part name="parameters" element="tns:PutMessage"/>
      </message>
      <message name="PutMessageSoapRequest">
        <part name="parameters" element="tns:PutMessageRequest"/>
      </message>
      <message name="PutMessageResponse">
        <part name="parameters" element="tns:PutMessageResponse"/>
      </message>
      <portType name="PutMessageSoapType">
        <operation name="PutMessage">
          <documentation>Returns the feedback by AzureServicebus when a message is pasted into it.</documentation>
          <input message="tns:PutMessageSoapRequest"/>
          <output message="tns:PutMessageResponse"/>
        </operation>
      </portType>
      <binding name="PutMessageSoapBinding" type="tns:PutMessageSoapType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="PutMessage">
          <soap:operation soapAction="" style="document"/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <binding name="PutMessageSoapBinding12" type="tns:PutMessageSoapType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="PutMessage">
          <soap12:operation soapAction="" style="document"/>
          <input>
            <soap12:body use="literal"/>
          </input>
          <output>
            <soap12:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="PutMessage">
        <documentation>The Web Service, to interact with azure service bus.</documentation>
        <port name="PutMessageSoap" binding="tns:PutMessageSoapBinding">
          <soap:address location="https://www.dataaccess.com/webservicesserver/numberconversion.wso"/>
        </port>
        <port name="PutMessageSoap12" binding="tns:PutMessageSoapBinding12">
          <soap12:address location="https://www.dataaccess.com/webservicesserver/numberconversion.wso"/>
        </port>
      </service>
    </definitions>

And uploaded the WSDL to the Azure API Manager.

enter image description here

enter image description here

Spring Boot SOAP CLient

Further

  • I have generated WebServiceFactory inheriting from jakarta.xml.ws.Service
  • and WebService "PutMessageSoapType" annotated with @WebService

So that I am now set to call the SOAP API.


    PutMessage_Service putMessageService = new PutMessage_Service();
    PutMessageSoapType myWebService = putMessageService.getPutMessageSoap();

    PutMessageRequest putMessageRequest = new PutMessageRequest();
    putMessageRequest.setMessage("");
    myWebService.putMessage(putMessageRequest);

Question:

what I fail to recognize is

how to point the Spring Boot SOAP Client to the Base URL https://alfdevapi5-example-apim.azure-api.net/suffix1 of the Azure API Manager API?

4
  • Can you show a screenshot of the Operations? learn.microsoft.com/en-us/azure/api-management/… Commented Aug 9, 2024 at 7:50
  • Sure, added. But which role does it play for my question? Commented Aug 9, 2024 at 8:45
  • /?soapAction=PutMessage - this looks like a query and not a part of the URL path. Although alfdevapi5-example-apim.azure-api.net/suffix1 is your base URL, the Frontend URL value of the operation adds another section to this path, e.g. if you put /suffix2 there then the whole URL for this operation would become alfdevapi5-example-apim.azure-api.net/suffix1/suffix2 - queries are not supposed to be used in the Frontend URL values, to my knowledge. Commented Aug 9, 2024 at 9:47
  • But how to use the "Base URL" in the Spring Boot code? Cant find a way to provide "Base URL" to the SOAP API call. Commented Aug 9, 2024 at 10:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.