function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pedzpedz 

Can't get started with SOAP

I think I am doing the right thing after all. I am sending the packet below to:

http://www.salesforce.com/services/Soap/c/7.0

or to

https://www.salesforce.com/services/Soap/c/7.0

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">




user@happyplace.net
doggy




And I get back this:


xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


xmlns:ns1="urn:fault.enterprise.soap.sforce.com">ns1:UNKNOWN_EXCEPTION


UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned
from login must be set in the SforceService


xsi:type="sf:UnexpectedErrorFault"
xmlns:sf="urn:fault.enterprise.soap.sforce.com">

UNKNOWN_EXCEPTION


Destination URL not reset. The URL returned from login
must be set in the SforceService







Please help...
SuperfellSuperfell
Can you repost a version that doesn't have the request XML messed up.
pedzpedz
I think I am doing the right thing after all.  I am sending the packet below to:

http://www.salesforce.com/services/Soap/c/7.0

or to

https://www.salesforce.com/services/Soap/c/7.0

<SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ns1="urn:enterprise.soap.sforce.com">
    <ns1:login>
      <ns1:username>user@happyplace.net</ns1:username>
      <ns1:password>doggy</ns1:password>
    </ns1:login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And I get back this:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode
          xmlns:ns1="urn:fault.enterprise.soap.sforce.com">ns1:UNKNOWN_EXCEPTION
      </faultcode>
      <faultstring>
        UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned
        from login must be set in the SforceService
      </faultstring>
      <detail>
        <sf:fault
            xsi:type="sf:UnexpectedErrorFault"
            xmlns:sf="urn:fault.enterprise.soap.sforce.com">
          <sf:exceptionCode>
            UNKNOWN_EXCEPTION
          </sf:exceptionCode>
          <sf:exceptionMessage>
            Destination URL not reset. The URL returned from login
            must be set in the SforceService
          </sf:exceptionMessage>
        </sf:fault>
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

Please help...
SuperfellSuperfell
Yeah, there's a known issue with the login service on www, it'll fail (when it shouldn't) if the body element has any attributes in it. Is there anyway you can move the ns decl to another element?
pedzpedz

SimonF wrote:
Is there anyway you can move the ns decl to another element?





Sorry to be ignorant but I'm not clear what you are asking. I should have pretty full control over what is being sent out. I'm using Python with ZSI. Its hard for me to use but I think it is pretty versatile.

So, if you can, please point out what I need to change.

Thank you so much for your help. I was afraid it had something to do with some set up problem on my side.
SuperfellSuperfell
<SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ns1="urn:enterprise.soap.sforce.com">
    <ns1:login>
      <ns1:username>user@happyplace.net</ns1:username>
      <ns1:password>doggy</ns1:password>
    </ns1:login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

move the bolded attribute somewhere else in the message, e.g.

<SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:login xmlns:ns1="urn:enterprise.soap.sforce.com">
      <ns1:username>user@happyplace.net</ns1:username>
      <ns1:password>doggy</ns1:password>
    </ns1:login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

or

<SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ns1="urn:enterprise.soap.sforce.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:login>
      <ns1:username>user@happyplace.net</ns1:username>
      <ns1:password>doggy</ns1:password>
    </ns1:login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


This problem will be fixed in the upcoming Winter release.
pedzpedz
Thanks.

I'll try sending a note to the ZSI mailing list and see if I get some help at making this change.
SuperfellSuperfell
also, If you know which instance you're on, you can send the login request directly there instead. (but i would reccommend you change it back to www once the winter release is out).
pedzpedz
Hey!!!

I replaced www with na1 (I logged in, and hoped it was the same server). I can at least log in. I haven't tried anything else but that got me past that step.

So... if anyone else is trying to follow all this: Python using ZSI, as a temporary work around, log in to the server by hand, look at the url's host, and then do:

# Create the sfapi locator
self.loc = SforceService_services.SforceServiceLocator()

# Create soap interface
self.soap = self.loc.getSoap(url="https://na1.salesforce.com/services/Soap/c/7.0", **kw)

where the na1 will be replaced with the host that you see after you log in by hand to your server. Note, this is just a temporary work around.

I'll post what I get back from the ZSI list as well.
pedzpedz
The recommendation I received from the ZSI list was to do this:

loc = SforceService_services.SforceServiceLocator()
soap = loc.getSoap(
            nsdict={ 'ns1' : 'urn:enterprise.soap.sforce.com' }
             )

This causes the out going message to move the xmlsn:ns1 attribute up
to the envelope. Thus:

<SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    xmlns:ns1="urn:enterprise.soap.sforce.com"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:login>
      <ns1:username>pedz@easesoftware.net
      </ns1:username>
      <ns1:password>gr82bfree
      </ns1:password>
    </ns1:login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>