与C#中的java类似的代码 [英] similar code as java in C#

查看:95
本文介绍了与C#中的java类似的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c#中获得类似的代码,任何人都可以帮我解决这个问题





I am trying to get similar code in c# any one can help me to resolve this issue


package com.xyz.international.clients;


import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;

import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;

import org.apache.commons.httpclient.methods.PostMethod;


public class availabilityWebserviceClientNew {


    public static void main(String[] args) throws IOException {

        HttpClient client =null;
        PostMethod method =null;

    String url="http://59.162.33.102:9301/Avalability";

        String response = "";

String request_str = "<AvailRequest>
<Trip>ONE</Trip>
<Origin>BOM</Origin>
<Destination>JFK</Destination>
<DepartDate>2014-02-15</DepartDate>
<ReturnDate>2014-02-20</ReturnDate>
<AdultPax>1</AdultPax>
<ChildPax>0</ChildPax>
<InfantPax>0</InfantPax>
<Currency>INR</Currency>
<PreferredClass>E</PreferredClass>
<Eticket>true</Eticket>
<Clientid>Given by Arzoo</Clientid>
<Clientpassword>Given by Arzoo</Clientpassword>
<Clienttype>ArzooINTLWS1.0</Clienttype>
<PreferredAirline></PreferredAirline>
</AvailRequest>";



MultiThreadedHttpConnectionManager connmngr=null;



connmngr = new MultiThreadedHttpConnectionManager();

        client = new HttpClient(connmngr);

        method = new PostMethod( url );

    method.addParameter("xmlRequest",request_str);

        client.executeMethod( method );

    response=method.getResponseBodyAsString();

        System.out.println("response "+response);
    }
}

推荐答案

https ://varycode.com/ [ ^ ]


这篇关于与C#中的java类似的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆