(A warning is an unholy mixture of xml and gratuitous character encoding below.)
Short version:
Why I can’t get my service reference call (C #,. Net 3.5, automatic service reference code added in VS2008) to correctly encode a parameter that should look like this wire: (find the bit "... This my curse.)
(other extra soapy ones are removed to remove clarity).
<SOAP-ENV:Body><SOAPSDK4:SetCondition xmlns:SOAPSDK4="http://tempuri.org/message/">
<sharedSecret>buggerall</sharedSecret>
<xmlData><SEARCHINFO_LIST><SEARCH_INFO action="add" status=&
quot;3" name="TestProfile2" mask="0" campaign_id="33"
campaign_protected="N" condition_protected="N"><CONDITIONS/&
gt;<EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST></xmlData>
</SOAPSDK4:SetCondition></SOAP-ENV:Body>
I set the parameter, make a call ... and the service will return a nice message "NO SOU-- SOAP FOR YOU!"
I tried several other formats in my passed-to-webservice options string:
action=\"add\"
who gave me this on a wire (through a violinist): action="add"
action="add"
who gave me this on a wire: action=&quot;add&quot;
(action = "add" "?!) html.encode, url.encode, , .
, <![CDATA["]]. .
innerHtml ?
* ( , , , , )
*
*
*
, :
,
(winform) . ( , mmc.
.)
, winform
-.
VS2008 " -"
( ),
-. , ,
GUI, ,
. . . (
, )
- - :
( , )
<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="
http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAPSDK4:SetCondition
xmlns:SOAPSDK4="http://tempuri.org/message/"><sharedSecret>0500001007C3525F3-F315-460D-
AF5C-D84767130126094</sharedSecret><xmlData><SEARCHINFO_LIST><SEARCH_INFO
action="add" status="3" name="TestProfile2" mask=&
quot;0" campaign_id="33"campaign_protected="N"
condition_protected="N"><CONDITIONS/><EXPRESSIONS/>&
lt;/SEARCH_INFO></SEARCHINFO_LIST></xmlData></SOAPSDK4:SetCondition></SOAP-
ENV:Body></SOAP-ENV:Envelope>
SOAP-y - <xmlData>, . ", :
<SEARCHINFO_LIST><SEARCH_INFO action="add"
status="3" name="TestProfile2" mask="0"
campaign_id="33" campaign_protected="N"
condition_protected="N"><CONDITIONS/><EXPRESSIONS/>&
lt;/SEARCH_INFO></SEARCHINFO_LIST>
, :
var serviceParams = "<SEARCHINFO-LIST><SEARCH_INFO action=\"add\"
status=\"3\" name=\"TestProfileFromExternApp\" mask=\"0\" campaign_id=\"33\"
campaign_protected=\"N\"
condition_protected=\"N\"><CONDITIONS/><EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST>";
, : ( ,
SOAP)
<SEARCHINFO-LIST><SEARCH_INFO action="add" status="3"
name="TestProfileFromExternApp" mask="0" campaign_id="33"
campaign_protected="N" condition_protected="N"><CONDITIONS/>
<EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST>
, . " d ## nit.
,
HTTP, .
"-!" : " !".
- :
var serviceParams = "<SEARCHINFO-LIST><SEARCH_INFO action="add"
status="3" name="TestProfileFromExternApp"
mask="0" campaign_id="33"
campaign_protected="N"
condition_protected="N"><CONDITIONS/><EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST>";
( , ) (
") &quot; :
<SEARCHINFO-LIST><SEARCH_INFO action=&quot;add&quot;
status=&quot;3&quot;
name=&quot;TestProfileFromExternApp&quot; mask=&quot;0&quot;
campaign_id=&quot;33&quot; campaign_protected=&quot;N&quot;
condition_protected=&quot;N&quot;><CONDITIONS/><EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST>
, , - "BZZT!
! ".
escape- .
, -
HttpUtility.HtmlEncode ,
&. (
double) . -
, , ", ,
.
, , ( ), , IClientMessageInspector BeforeSendRequest... , .
. ".
, wirehark fiddler , ... , .
<xmlData xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SEARCHINFO-LIST><SEARCH_INFO action="add" status="3"
name="TestProfileFromExternApp" mask="0" campaign_id="33" campaign_protected="N"
condition_protected="N"><CONDITIONS/><EXPRESSIONS/>
</SEARCH_INFO></SEARCHINFO_LIST></xmlData>
. [ ] [vile deity] [] [//son bionacle ]. , .
, :
( , , ...)
public int SetCondition(string sharedSecret, string xmlData, out string resultValue)
{
tzGui.tzCampaign.SetConditionRequest inValue = new tzGui.tzCampaign.SetConditionRequest();
inValue.sharedSecret = sharedSecret;
inValue.xmlData = xmlData;
tzGui.tzCampaign.SetConditionResponse retVal = ((tzGui.tzCampaign.CampaignSoapPort)(this)).SetCondition(inValue);
resultValue = retVal.resultValue;
return retVal.Result;
}
:
void SetConditionTask()
{
var tzCampaignCxn = new tzCampaign.CampaignSoapPortClient("CampaignSoapBinding");
string xmlData = "<SEARCHINFO-LIST><SEARCH_INFO action="add" status="3" name="TestProfileFromExternApp" mask="0" campaign_id="33" campaign_protected="N" condition_protected="N"><CONDITIONS/><EXPRESSIONS/></SEARCH_INFO></SEARCHINFO_LIST>";
string createProfileResultVal = string.Empty;
tzCampaignCxn.SetCondition(SharedSecret, xmlData, out createProfileResultVal);
txtResults.AppendText(Environment.NewLine + Environment.NewLine + createProfileResultVal);
}