Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSDL ... Non-WSDL mode? #232

Open
faithfulman18 opened this issue Feb 6, 2021 · 7 comments
Open

WSDL ... Non-WSDL mode? #232

faithfulman18 opened this issue Feb 6, 2021 · 7 comments
Assignees
Labels

Comments

@faithfulman18
Copy link
Contributor

Hello,

I have a new issue that is related to #231 but I thought it made the most sense to open a new ticket.

So, now that the SOAP packet is being sent in the correct format, the issue now is that server doesn't have the WSDL on it. So, I'm not sure, but I'm thinking that would make me need to use "Non-WSDL" mode??

If so, it appears that the URL is supposed to be null and the uri and location should be filled in. However, this isn't working. If I input the path to the local WSDL, it complains with a SOAPFAULT of "Looks like we got no XML document". (which there isnt' a WSDL on the server side from the vendor) .... but if we leave the URL null, then the package generator is looking for the WSDL file in a local folder on the webserver and bombs out.

Any ideas? Help!?

Thanks!

@mikaelcom mikaelcom self-assigned this Feb 6, 2021
@mikaelcom
Copy link
Member

From my knowledge Looks like we got no XML document means the server did not respond with a valid XML response, not that it has no WSDL on its side.

If you have a WSDL, you can nevertheless set the location, the url, to where the request must be sent because the WSDL may contain a SOAP address location with a localhost url or it might even not contain any.

To set the location of where the request must be sent, you have to call the method setLocation on the SerciveType instance passing the SOAP address location.

Am I mistaken?

@faithfulman18
Copy link
Contributor Author

Whoops. I had overwritten my URL variable and it really wasn't pointing to the correct location. So disregard that issue as I do get a response back, but it's only when I pass in the local path to the WSDL in the URL setting. If I don't it also tries to send the SOAP packet, but the format is different:

[With WSDL PATH in the URL optoin -- looks normal and works]

      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'myfilepath\this.wsdl',
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URI => 'http://this namespace.com',
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \THIS_WSDL\ClassMap::get(),
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_SOAP_VERSION => SOAP_1_1,
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CACHE_WSDL => WSDL_CACHE_BOTH,
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOCATION => $this->url,

{Result}

        <ns1:vendorHeader>
          <ns1:ConsumerName>NAMELISTED</ns1:ConsumerName>
          <ns1:ConsumerProduct>PRODUCTLISTED</ns1:ConsumerProduct>
          ...
          ...
          <ns1:thisPropertyNotBeingUsed/>
        </ns1:vendorHeader>

VS

[No WSDL PATH in the URL option -- looks different and fails from the server side response]

      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URI => 'http://this namespace.com',
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \THIS_WSDL\ClassMap::get(),
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_SOAP_VERSION => SOAP_1_1,
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CACHE_WSDL => WSDL_CACHE_BOTH,
      \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOCATION => $this->url,

{Result}

        <vendorHeader xsi:type="SOAP-ENC:Struct">
          <ConsumerName xsi:type="xsd:string">NAMELISTED</ConsumerName>
          <ConsumerProduct xsi:type="xsd:string">PRODUCTLISTED</ConsumerProduct>
          ...
          ...
          <thisPropertyNotBeingUsed xsi:nil="true"/>
        </vendorHeader>

Any idea why the difference? Am I doing something wrong or missing anything?

@mikaelcom
Copy link
Member

I'm not sure to follow, what's the real issue?

  • What do you expect?
  • What is happening ?
  • What is wrong ?

@faithfulman18
Copy link
Contributor Author

I'm just wondering confused what made it output the SOAP packet differently. I'm not passing the URL parameter the local wsdl in the 2nd instance, and it generates the SOAP similarly, but not the same. It essentially includes the 'ns1:' on all the fields in the first instance and on the one without the local WSDL file path it generates it without the 'ns1' and with those extra 'xsi:' attributes.

Is there a reason behind it? I'm just trying to understand the difference and what is causing it to generate the SOAP packet differently.

@faithfulman18
Copy link
Contributor Author

To clarify more ... using the first example does work properly and I get a proper soap response back now. (Yea!)

I was just trying to understand why the output changes when I do not pass in the local URL of the wsdl versus when I do.

@mikaelcom
Copy link
Member

If the SoapClient has the WSDL, it can namespace the parameter so you end up with ns1:, otherwise it types the parameter as they are without namespacing them.

@faithfulman18
Copy link
Contributor Author

Alright. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants