• Dean Barnes
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

I am trying to create a bit of Apex code that will loop through accounts, find the associated contacts and then loop through the contacts to get their names. I'm not having much luck, but has anyone done this before and knows how to do it?

I'm sure this is obvious, but I can't find it so forgive me. But, does dataloader have to create a csv when moving data from one database to another? If not, then does anyone have an example of the required configuration files to avoid creating the csv?

I am trying to change the wsdl2apex code for a web service call header that currently looks like this:

<env:Header>
<Security xmlns="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<UsernameToken Id="UsernameToken-4">
<Username>test</Username>
<Password>test</Password>
</UsernameToken>
</Security>
</env:Header>

to look like this:

<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-4" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>Test</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Test</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

One problem is that I can't work out how to change the namespaces for elements (or even if it matters what name they have). A secondary problem is putting the Type attribute onto the Password element.

 

Can any provide any information that might help?

 

Thanks

I am trying to create a bit of Apex code that will loop through accounts, find the associated contacts and then loop through the contacts to get their names. I'm not having much luck, but has anyone done this before and knows how to do it?