Trying to get soapclient add xsi:type to request
up vote
1
down vote
favorite
So Im passing a field of array items to a web service call and the request and response looks ok, but Im trying to get the Value attribute to tell the type, so this is my fields:
$fields = array(
"Password"=>'password',
"entity"=>array(
"Name" =>"namehere",
"Id"=>'1234',
"Attributes"=>
array(
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key1',
"Value"=>'1',
),
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key2',
"Value"=>'2',
),
array(
"AttributeType"=>'DateAndTime',
"Key"=>'Key3',
"Value"=>'2016-09-16T00:00:00'
)
)
)
);
So my REQUEST is :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:Create>
<ns1:Password>password</ns1:Password><ns1:entity>
<ns1:Name>namehere</ns1:Name><ns1:Id>1234</ns1:Id><ns1:Attributes><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key1</ns1:Key><ns1:Value>1</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key2</ns1:Key><ns1:Value>2</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>DateAndTime</ns1:AttributeType>
<ns1:Key>Key3</ns1:Key><ns1:Value>2016-09-16T00:00:00</ns1:Value></ns1:Attribute></ns1:Attributes></ns1:entity>
</ns1:Create></SOAP-ENV:Body></SOAP-ENV:Envelope>
So you can see < ns1:Value >1< /ns1:Value > but I need it to be like able to determine what the type is so like < Value xsi:type="xsd:string" >1< /Value> or < Value xsi:type="xsd:dateTime" >2016-09-16T00:00:00< /Value> if its a date field, I have tried to do loop through and assign it but it does not seem to work, here is the loop I have tried
foreach($fields['entity']['Attributes'] as $attribute)
echo $attribute['Value'] = new SoapVar($attribute, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
php arrays soap
add a comment |
up vote
1
down vote
favorite
So Im passing a field of array items to a web service call and the request and response looks ok, but Im trying to get the Value attribute to tell the type, so this is my fields:
$fields = array(
"Password"=>'password',
"entity"=>array(
"Name" =>"namehere",
"Id"=>'1234',
"Attributes"=>
array(
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key1',
"Value"=>'1',
),
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key2',
"Value"=>'2',
),
array(
"AttributeType"=>'DateAndTime',
"Key"=>'Key3',
"Value"=>'2016-09-16T00:00:00'
)
)
)
);
So my REQUEST is :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:Create>
<ns1:Password>password</ns1:Password><ns1:entity>
<ns1:Name>namehere</ns1:Name><ns1:Id>1234</ns1:Id><ns1:Attributes><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key1</ns1:Key><ns1:Value>1</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key2</ns1:Key><ns1:Value>2</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>DateAndTime</ns1:AttributeType>
<ns1:Key>Key3</ns1:Key><ns1:Value>2016-09-16T00:00:00</ns1:Value></ns1:Attribute></ns1:Attributes></ns1:entity>
</ns1:Create></SOAP-ENV:Body></SOAP-ENV:Envelope>
So you can see < ns1:Value >1< /ns1:Value > but I need it to be like able to determine what the type is so like < Value xsi:type="xsd:string" >1< /Value> or < Value xsi:type="xsd:dateTime" >2016-09-16T00:00:00< /Value> if its a date field, I have tried to do loop through and assign it but it does not seem to work, here is the loop I have tried
foreach($fields['entity']['Attributes'] as $attribute)
echo $attribute['Value'] = new SoapVar($attribute, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
php arrays soap
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
So Im passing a field of array items to a web service call and the request and response looks ok, but Im trying to get the Value attribute to tell the type, so this is my fields:
$fields = array(
"Password"=>'password',
"entity"=>array(
"Name" =>"namehere",
"Id"=>'1234',
"Attributes"=>
array(
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key1',
"Value"=>'1',
),
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key2',
"Value"=>'2',
),
array(
"AttributeType"=>'DateAndTime',
"Key"=>'Key3',
"Value"=>'2016-09-16T00:00:00'
)
)
)
);
So my REQUEST is :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:Create>
<ns1:Password>password</ns1:Password><ns1:entity>
<ns1:Name>namehere</ns1:Name><ns1:Id>1234</ns1:Id><ns1:Attributes><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key1</ns1:Key><ns1:Value>1</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key2</ns1:Key><ns1:Value>2</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>DateAndTime</ns1:AttributeType>
<ns1:Key>Key3</ns1:Key><ns1:Value>2016-09-16T00:00:00</ns1:Value></ns1:Attribute></ns1:Attributes></ns1:entity>
</ns1:Create></SOAP-ENV:Body></SOAP-ENV:Envelope>
So you can see < ns1:Value >1< /ns1:Value > but I need it to be like able to determine what the type is so like < Value xsi:type="xsd:string" >1< /Value> or < Value xsi:type="xsd:dateTime" >2016-09-16T00:00:00< /Value> if its a date field, I have tried to do loop through and assign it but it does not seem to work, here is the loop I have tried
foreach($fields['entity']['Attributes'] as $attribute)
echo $attribute['Value'] = new SoapVar($attribute, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
php arrays soap
So Im passing a field of array items to a web service call and the request and response looks ok, but Im trying to get the Value attribute to tell the type, so this is my fields:
$fields = array(
"Password"=>'password',
"entity"=>array(
"Name" =>"namehere",
"Id"=>'1234',
"Attributes"=>
array(
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key1',
"Value"=>'1',
),
array(
"AttributeType"=>'SingleLineOfText',
"Key"=>'Key2',
"Value"=>'2',
),
array(
"AttributeType"=>'DateAndTime',
"Key"=>'Key3',
"Value"=>'2016-09-16T00:00:00'
)
)
)
);
So my REQUEST is :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:Create>
<ns1:Password>password</ns1:Password><ns1:entity>
<ns1:Name>namehere</ns1:Name><ns1:Id>1234</ns1:Id><ns1:Attributes><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key1</ns1:Key><ns1:Value>1</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>SingleLineOfText</ns1:AttributeType>
<ns1:Key>Key2</ns1:Key><ns1:Value>2</ns1:Value>
</ns1:Attribute><ns1:Attribute>
<ns1:AttributeType>DateAndTime</ns1:AttributeType>
<ns1:Key>Key3</ns1:Key><ns1:Value>2016-09-16T00:00:00</ns1:Value></ns1:Attribute></ns1:Attributes></ns1:entity>
</ns1:Create></SOAP-ENV:Body></SOAP-ENV:Envelope>
So you can see < ns1:Value >1< /ns1:Value > but I need it to be like able to determine what the type is so like < Value xsi:type="xsd:string" >1< /Value> or < Value xsi:type="xsd:dateTime" >2016-09-16T00:00:00< /Value> if its a date field, I have tried to do loop through and assign it but it does not seem to work, here is the loop I have tried
foreach($fields['entity']['Attributes'] as $attribute)
echo $attribute['Value'] = new SoapVar($attribute, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
php arrays soap
php arrays soap
asked Nov 9 at 21:32
LookingToHelp
61
61
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233522%2ftrying-to-get-soapclient-add-xsitype-to-request%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown