WsdlToPhp / PackageBase

Contains base classes from which the generated classes from PackageGenerator inherit
MIT License
24 stars 26 forks source link

How to change soap address #18

Closed tvaughan73 closed 6 years ago

tvaughan73 commented 6 years ago

I am working with the wsdl below and I was just informed that the address the soap call needs to go to can be different depending on the user.

The wsdl has https://partnerdev.hostedtax.thomsonreuters.com/sabrix/services/taxservice/2009-12-20/taxservice set as the URL but it may need to use a different URL. Is there any way to change this when I am building the soap call or would I need a separate wsdl for each URL?

<?xml version="1.0" ?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.sabrix.com/services/taxservice/2009-12-20/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.sabrix.com/services/taxservice/2009-12-20/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.sabrix.com/services/taxservice/2009-12-20/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.sabrix.com/services/taxservice/2009-12-20/">

  <xs:include schemaLocation="https://partnerdev.hostedtax.thomsonreuters.com/sabrix/services/taxservice/2009-12-20/taxservice?xsd=TaxServiceMessages.xsd"></xs:include>

</xs:schema>
  </wsdl:types>
  <wsdl:message name="GetTaxSoapIn">
    <wsdl:part element="tns:TaxRequest" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="GetTaxSoapOut">
    <wsdl:part element="tns:TaxResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="SimpleTaxService">
    <wsdl:operation name="GetTax">
      <wsdl:input message="tns:GetTaxSoapIn">
    </wsdl:input>
      <wsdl:output message="tns:GetTaxSoapOut">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="TaxServiceSoap" type="tns:SimpleTaxService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
    <wsdl:operation name="GetTax">
      <soap:operation soapAction="http://www.sabrix.com/services/taxservice/2009-12-20/GetTax" style="document"></soap:operation>
      <wsdl:input>
        <soap:body use="literal"></soap:body>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"></soap:body>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="TaxServiceSoap12" type="tns:SimpleTaxService">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"></soap12:binding>
    <wsdl:operation name="GetTax">
      <soap12:operation soapAction="http://www.sabrix.com/services/taxservice/2009-12-20/GetTax" style="document"></soap12:operation>
      <wsdl:input>
        <soap12:body use="literal"></soap12:body>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"></soap12:body>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="TaxService">
    <wsdl:port binding="tns:TaxServiceSoap" name="TaxServiceSoap">
      <soap:address location="https://partnerdev.hostedtax.thomsonreuters.com/sabrix/services/taxservice/2009-12-20/taxservice"></soap:address>
    </wsdl:port>
    <wsdl:port binding="tns:TaxServiceSoap12" name="TaxServiceSoap12">
      <soap:address location="/taxService/2009-12-20/taxservice"></soap:address>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
tvaughan73 commented 6 years ago

never mind. I figured it out. Thanks

mikaelcom commented 6 years ago

Just for others who would also wonder, you can call the setLocation method from the ServiceType instance